# −∗− coding: utf−8 −∗−
import calendar
import SimpleHTTPServer
import SocketServer
import sys
cal = calendar.HTMLCalendar()
html = cal.formatyearpage(int(sys.argv[1]))
f = open("index.html", "w")
f.write(html)
f.close()
PORT = 8000
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer(("", PORT), Handler)
print "serving at port", PORT
httpd.serve_forever()
print "usage: cal1.py ano"
